<!-- 废弃页面 -->
<template>
  <view class="my-page">
    <!-- 顶部紫色背景图片 -->
    <image class="header-img" src="/static/images/card1.png" mode="widthFix" />

    <!-- 白色卡片区域 -->
    <view class="profile-card">
      <image class="avatar" src="/static/images/logo.png" />
      <view class="nickname">Nexity</view>
      <view class="desc">去实名</view>
      <view class="stats">
        <text>
          <text class="num">10</text>
          点赞
        </text>
        <text>
          <text class="num">731</text>
          关注
        </text>
        <text>
          <text class="num">1731</text>
          粉丝
        </text>
      </view>
      <view class="bio"
        >Happy to present the logo animation I created for Blocs, a
        website–builder app.What do you think</view
      >
    </view>

    <!-- 标签页导航 -->
    <view class="tabs-container">
      <view class="tab-item active">发行</view>
      <view class="tab-item">收藏</view>
      <view class="tab-item">交易</view>
    </view>

    <!-- 作品列表 -->
    <view class="card-list">
      <view class="card">
        <view class="card-status status-review">审核中</view>
        <image class="card-img" src="/static/images/1.png" />
        <view class="card-title">猫饭仔#010半</view>
        <view class="card-bottom">
          <text class="price">¥322.00</text>
          <text class="likes"><text class="icon">♡</text> 0</text>
        </view>
      </view>
      <view class="card">
        <view class="card-status status-issued">已发行</view>
        <image class="card-img" src="/static/images/2.png" />
        <view class="card-title">UP兔英雄俱乐部</view>
        <view class="card-bottom">
          <text class="price">¥322.00</text>
          <text class="likes"><text class="icon">♡</text> 239</text>
        </view>
      </view>
      <view class="card">
        <view class="card-status status-done">已结绝</view>
        <image class="card-img" src="/static/images/3.png" />
        <view class="card-title">咕鸭-普通款</view>
        <view class="card-bottom">
          <text class="price">¥322.00</text>
          <text class="likes"><text class="icon">♡</text> 0</text>
        </view>
      </view>
      <view class="card">
        <view class="card-status status-hot">巨量出</view>
        <image class="card-img" src="/static/images/4.png" />
        <view class="card-title">专属鱼鱼</view>
        <view class="card-bottom">
          <text class="price">¥322.00</text>
          <text class="likes"><text class="icon">♡</text> 239</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { ref } from "vue";

// 选项卡状态管理
const activeTab = ref("issued");

const switchTab = (tab) => {
  activeTab.value = tab;
};
</script>

<style lang="scss">
/* 全局样式 */
.my-page {
  background: #f7f7fa;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  position: relative;
}

.header-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.profile-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(160, 160, 160, 0.08);
  margin: -48px 16px 0 16px;
  padding: 24px 0 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #fff;
    margin-bottom: 8px;
    margin-top: -36px;
    background: #fff;
  }
  .nickname {
    font-size: 22px;
    font-weight: bold;
    color: #222;
    margin-bottom: 2px;
  }
  .desc {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
  }
  .stats {
    display: flex;
    gap: 24px;
    font-size: 15px;
    color: #222;
    margin-bottom: 8px;
    .num {
      font-weight: bold;
      font-size: 16px;
      margin-right: 2px;
    }
  }
  .bio {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin: 0 16px;
  }
}

/* 标签页导航 */
.tabs-container {
  display: flex;
  margin: 16px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

  .tab-item {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 16px;
    color: #666;
    position: relative;

    &.active {
      color: #1976d2;
      font-weight: 600;

      &::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
        height: 3px;
        background-color: #1976d2;
        border-radius: 2px;
      }
    }
  }
}

/* 作品网格 */
.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px 20px;

  .work-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .work-image {
    width: 100%;
    height: 160px;
    display: block;
  }

  .work-info {
    padding: 12px;
  }

  .work-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
  }

  .work-price {
    font-size: 16px;
    font-weight: bold;
    color: #ff5722;
    margin-bottom: 8px;
  }

  .work-status {
    font-size: 12px;
    color: #4caf50;
    background-color: #e8f5e9;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;

    &.reviewing {
      background-color: #fff8e1;
      color: #ff8f00;
    }

    &.issued {
      background-color: #e8f5e9;
      color: #2e7d32;
    }

    &.rejected {
      background-color: #ffebee;
      color: #c62828;
    }
  }
}

.card-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 0 12px;
  margin-top: 8px;
  box-sizing: border-box;
}

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(160, 160, 160, 0.1);
  padding: 14px 10px 12px 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.card-status {
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 8px;
  font-size: 12px;
  padding: 2px 10px;
  color: #fff;
  font-weight: 500;
  z-index: 2;
  &.status-review {
    background: #6dd400;
  }
  &.status-issued {
    background: #ffb800;
  }
  &.status-done {
    background: #bbb;
  }
  &.status-hot {
    background: #ff3b30;
  }
}

.card-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 10px;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: #f5f5f5;
}

.card-title {
  font-size: 15px;
  font-weight: bold;
  color: #222;
  margin-bottom: 6px;
  margin-top: 2px;
}

.card-bottom {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price {
  color: #ff3b30;
  font-size: 15px;
  font-weight: bold;
}

.likes {
  color: #bbb;
  font-size: 13px;
  display: flex;
  align-items: center;
  .icon {
    font-size: 13px;
    margin-right: 2px;
  }
}
</style>
